#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：8.元组.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-09-26 15:17
'''

int_tuple = (1, 2, 3, 4)

print(type(int_tuple))

print("-" * 30)
""" 访问元组 """
print(int_tuple[0])

""" 循环取值"""
for temp in int_tuple:
    print(temp)

""" 切片取值"""
print(int_tuple[1:3])

print(id(int_tuple[0]))

nums = (1, 2, 3, [4, 5])
print(nums)
print(id(nums[3]))
nums[3][0] = 0
print(id(nums[3]))
print(nums)


int_tuple = ()

a = 'abc'
b = a

print(id(a))
print(id(b))

a = []
b = a

print(id(a))
print(id(b))

a = 'a'
b = 'a'
print(id(a))
print(id(b))



a = 'abcd'
b = 'abcd'
print(id(a))
print(id(b))

temp = (1)
temp1 = (1,)
print(temp)
print(type(temp))
print(temp1)
print(type(temp1))

